<template>
    <iframe src="http://lbsyun.baidu.com/custom/"
            :style="iStyle"></iframe>
</template>

<script>
    export default {
        name: "baiduLbsCustom",
        data() {
            return {
                iStyle: {
                    width: '100%',
                    height: '100%',
                    paddingTop: 0
                },
            }
        },

        methods:{
            resetSize() {
                try {
                    let fullHeight = document.getElementById("loadPageDiv").offsetHeight;
                    this.iStyle.height = fullHeight + 'px';
                } catch (e) {
                }

                let that = this;
                if (that && !that._isDestroyed) {
                    setTimeout(() => {
                        if (that && !that._isDestroyed) {
                            that.resetSize();
                        }
                    }, 500);
                }
            },
        },

        mounted: function () {
            let that = this;
            if (that && !that._isDestroyed) {
                that.resetSize();

                setTimeout(()=>{
                    that.initEchart();
                }, 3000);
            }
        }

    }
</script>

<style scoped>

</style>